package com.allenkerr.service;

import com.allenkerr.model.Book;
import com.allenkerr.vo.BookSearchParams;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

public interface BookService {

    Book save(Book book);

    void delete(Book book);

    Book findOne(String id);

    Iterable<Book> findAll();

    Page<Book> findByAuthor(String author, PageRequest pageRequest);

    List<Book> findByTitle(String title);

    Map<String, List<Book>> findByTitleIsLike(String title);

    Iterator<Book> init(List<Book> bookList);

    List<Book> listBooks(BookSearchParams searchParams);
}